<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Admin Catoira-García</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<style media="all" type="text/css">@import "css/all.css";</style>
</head>
<body>
<div id="main">
	<div id="header">
		<a href="index.html" class="logo"><img src="img/logo.gif" width="101" height="29" alt="" /></a>
		<ul id="top-navigation">
			<li><span><span><a href="adminpropiedades.php">Propiedades</a></span></span></li>
			<li><span><span><a href="#">Fotos</a></span></span></li>
			<li><span><span><a href="#">Noticias</a></span></span></li>
			<li><span><span><a href="#">Usuarios</a></span></span></li>
			<li><span><span><a href="#">Statistics</a></span></span></li>
			<li><span><span><a href="#">Design</a></span></span></li>
			<li><span><span><a href="#">Contents</a></span></span></li>
		</ul>
	</div>
	<div id="middle">


                        <div id="center-column">
			<div class="top-bar">
				<h1>Modificar Propiedad</h1>
				<div class="breadcrumbs">Administración de propiedades de Catoira-García</div>
			</div><br />
                        <div class="select-bar"></div>
                        <?php
                       
                        include 'conexionbd.php';

                        $idpropiedad = $_GET['idpropiedad'];
                        
                        $result = mysql_query("SELECT * FROM propiedad WHERE id='$idpropiedad'", $link);

                        $row=mysql_fetch_array($result);
                        

                        echo'<form method = "POST" action = "realizarmodificacionpropiedad.php">';

                        echo'<h3><Blockquote>Tipo:<select name="tipo">';
                        switch ($row['tipo']){
                            case "Casa":
                                    echo '<option>Casa</option>
                                    <option>Dpto</option>
                                    <option>Terreno</option>
                                    <option>Local</option>
                                    <option>Galpón</option>';
                                    break;
                            case "Dpto":
                                    echo '<option>Dpto</option>
                                    <option>Casa</option>
                                    <option>Terreno</option>
                                    <option>Local</option>
                                    <option>Galpón</option>';
                                    break;
                            case "Terreno":
                                    echo '<option>Terreno</option>
                                    <option>Casa</option>
                                    <option>Dpto</option>
                                    <option>Local</option>
                                    <option>Galpón</option>';
                                    break;
                            case "Local":
                                    echo '<option>Local</option>
                                    <option>Casa</option>
                                    <option>Dpto</option>
                                    <option>Terreno</option>
                                    <option>Galpón</option>';
                                    break;
                            case "Galpón":
                                    echo '<option>Galpón</option>
                                    <option>Casa</option>
                                    <option>Dpto</option>
                                    <option>Terreno</option>
                                    <option>Local</option>';
                                    break;
                        }

                        echo '</select></h3></Blockquote>';

                        
                        


                        echo '<h3><Blockquote>Dirección: <input type="text" name="direccion" size="30" value="'.$row['direccion'].'"></h3></Blockquote>';
                        echo '<h3><Blockquote>Dormitorios: <input type="text" name="dormitorios" size="1" value='.$row['dormitorios'].'></h3></Blockquote>';
                        echo '<h3><Blockquote>Baños: <input type="text" name="banos" size="1" value='.$row['banos'].'></h3></Blockquote>';
                        echo '<h3><Blockquote>Ambientes: <input type="text" name="ambientes" size="1" value='.$row['ambientes'].'></h3></Blockquote>';
                        echo '<h3><Blockquote>Garage: <input type="text" name="garage" size="5" value="'.$row['garage'].'"></h3></Blockquote>';
                        echo '<h3><Blockquote>Patio: <input type="text" name="patio" size="5" value="'.$row['patio'].'"></h3></Blockquote>';
                        echo '<h3><Blockquote>Quincho: <input type="text" name="quincho" size="5" value="'.$row['quincho'].'"></h3></Blockquote>';
                        echo '<h3><Blockquote>Terreno: <input type="text" name="terreno" size="5" value="'.$row['terreno'].'"></h3></Blockquote>';
                        echo '<h3><Blockquote>Barrio: <input type="text" name="barrio" size="30" value="'.$row['barrio'].'"></h3></Blockquote>';
                        echo '<h3><Blockquote>Localidad: <input type="text" name="localidad" size="30" value="'.$row['localidad'].'"></h3></Blockquote>';

                        echo '<h3><Blockquote>Situación: <select name="situacion">';
                        if ($row['enalquiler']==1 && $row['enventa']==1)
                        {
                            echo'<option>En Alquiler y Venta</option>
                                <option>En Alquiler</option>
                                <option>En Venta</option>';
                        }
                        elseif ($row['enalquiler']==1)
                        {

                            echo'<option>En Alquiler</option>
                                <option>En Venta</option>
                                <option>En Alquiler y Venta</option>';
                        }
                         elseif ($row['enventa']==1)
                         {
                         echo'<option>En Venta</option>
                                <option>En Alquiler</option>
                                <option>En Alquiler y Venta</option>';
                         }

                        echo '</select></h3></Blockquote>';

                        

                        echo '<h3><Blockquote>Alquiler: <input type="text" name="alquiler" size="5" value='.$row['alquiler'].'></h3></Blockquote>';
                        echo '<h3><Blockquote>Valor: <input type="text" name="precio" size="5" value='.$row['precio'].'></h3></Blockquote>';
                        

                        
                        echo '<h3><Blockquote>Publicar: <select name="selected">';
                        if ($row['selected']==1)
                         {
                         echo'<option>Sí</option>
                                <option>No</option>';
                         }

                        if ($row['selected']==0)
                         {
                         echo'<option>No</option>
                                <option>Sí</option>';
                         }

                        echo '</select></h3></Blockquote>';




                        echo '<Blockquote><input type="submit" value="Modificar" name="modificador"></Blockquote>';

                        echo '<input name="id" type="hidden" value="'.$row['id'].'"/>';

                        echo '</form>';
                        ?>

		</div>

	</div>
	<div id="footer"></div>
</div>


</body>
</html>


